home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
samples.zip
/
COUNT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-03-25
|
1KB
|
50 lines
{--------------------------------------}
{ For-Next Looping Demonstration(s) !! }
{ Desc: Count to a Number, then Exit }
{ Written by Mike Schreckengost in TP! }
{--------------------------------------}
Program For_Next_Looping;
Var End_Of_Loop:Integer;
Count_Loop:Integer;
Procedure Input_Required_Data;
Begin
Repeat;
Clrscr;
Gotoxy(1,1);
Textcolor(1);
Write('Enter Number to Count to --> ');
Textcolor(7);
Readln(End_Of_Loop);
Until End_Of_Loop>0;
End;
Procedure Print_Legal_Data;
Begin
Textcolor(2);
Writeln;
Writeln('Counting ... Please Wait ...');
Writeln;
Textcolor(7);
For Count_Loop:=1 to End_Of_Loop Do
Writeln(Count_Loop);
Count_Loop:=Count_Loop+1;
End;
Procedure End_Program;
Begin
Textcolor(12);
Writeln;
Writeln('All Done Counting !!!');
Textcolor(7);
End_Of_Loop:=0
End;
Begin
Input_Required_Data;
Print_Legal_Data;
End_Program;
End.